import request from '@/utils/request'


// 厂区字典查询
export function getDictList(query) {
  return request({
    url: `/sys-dict/list?type=area`,
    method: 'post',
    data: {
    }
  })
}

export function listSelct(query) {
  return request({
    url: '/pigfarm-info/listSelct',
    method: 'post',
    data: {
      deptId:query
    }
  })
}

// 列表页查询
export function delForm(query) {
  return request({
    url: `/pigfarm-project/delete/${query}`,
    method: 'get',
    // data: query
  })
}

// 列表页查询
export function listForm(query) {
  return request({
    url: '/pigfarm-project/list',
    method: 'post',
    data: query
  })
}
// 片区
export function getTreeselect() {
  return request({
    url: '/auth/dept/treeselect',
    method: 'get',
  })
}

export function updateFarmInfo(query) {
  return request({
    url: '/pigfarm-project/update',
    method: 'post',
    data: query
  })
}


// 新增档案
export function addFarmInfo(query) {
  return request({
    url: '/pigfarm-project/add',
    method: 'post',
    data: query
  })
}
// 查看详情
export function getDetailsById(query) {
  return request({
    url: `/pigfarm-project/getById/${query}`,
    method: 'get',
    // data: query
  })
}


/**
 *查询任务分配按钮权限
 * @param id
 */
export function getTaskDistributeBtnById(id) {
  return request({
    url: `/design-info/complete/${id}`,
    method: 'get',
  })
}

/**
 *任务分配
 * @param projectId
 * @param dealOa
 * @param dealName
 */
export function setTaskDistributeApi(projectId,dealOa,dealName) {
  return request({
    url: `/pigfarm-project/setDesign `,
    method: 'post',
    data:{
      projectId,dealOa,dealName
    }
  })
}


// srm数据同步
export function srmSysnc(query) {
  return request({
    url: `/pigfarm-project/synch/${query}`,
    method: 'get',
  })
}

